import utils from '../utils'

function userLogin(username, password) {
    return utils.post('/madmin/login', {
        phone: username,
        password: password
    })
}

function fetchGoodsInfo(limit, offset, typeId, keywords) {
    return utils.get("/madmin/goods", {})
}

function fetchOrderInfo(limit, offset, userId) {
    return utils.get("/madmin/order")
}

function addNewGoodsCategory(parent, name) {
    return utils.post("/madmin/category", {})
}

function deleteGoodsCategory(id) {
    return utils.delete("/madmin/category")
}

function getGoodsCategory() {
    return utils.get("/madmin/category")
}


export default {
    fetchGoodsInfo,
    fetchOrderInfo,
    userLogin,
    addNewGoodsCategory,
    getGoodsCategory
}